package sessionBeanTest;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import sessionbean.CounterRemote;
public class CountTest {
	public static void main(String[] args) throws NamingException {
		//读取　jndi.properties
		Context context=new InitialContext();
		//Global JNDI Namespace,全局唯一Counter
		CounterRemote counter=(CounterRemote) context.lookup("Counter/remote");
		for (int i = 0; i < 10; i++) {
			counter.count();
		}
		System.out.println(counter.getTimes());
		counter.remove();
	}
}
